<script setup lang="ts">
import { computed, ref } from 'vue'
import { useRoute } from 'vue-router'
const active = ref(0)
const route = useRoute()

const show = computed(() => {
  if (route.meta.level && route.meta.level === 1) return true
  return false
})
</script>

<template>
  <van-tabbar v-if="show" v-model="active" placeholder route>
    <van-tabbar-item replace to="/">
      首页
      <template #icon>
        <div class="i-carbon:home" />
      </template>
    </van-tabbar-item>
    <van-tabbar-item replace to="/profile">
      个人中心
      <template #icon>
        <div class="i-carbon:user" />
      </template>
    </van-tabbar-item>
  </van-tabbar>
</template>
